Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDraft


BeginClone

The BeginClone method initiates a cloning transaction to transfer data from this draft to the specified destination draft.

ODDraftKey BeginClone (in ODDraft destDraft, 
                       in ODFrame destFrame,
                       in ODCloneKind kind);
destDraft
A reference to the destination draft to which objects are to be cloned.
destFrame
A reference to the destination frame, or kODNULL if the clone operation is not a paste or a drop.
kind
The kind of clone operation being performed.
return value
The draft key for this cloning transaction.
DISCUSSION
The BeginClone method sets up a cloning transaction of the specified kind and returns a unique draft key that identifies the transaction. Other methods involved in cloning require you to supply this draft key as a parameter. The Bento container suite allows only one cloning transaction at any given time.

The destFrame parameter allows OpenDoc to detect an attempt to move a part into one of its embedded frames. For pasting operations, the destFrame parameter should be set to the part's active frame. For dropping operations, this parameter should be set to the drop target frame. In all other cases, this parameter should be set to null.

The kind parameter indicates the nature of the cloning operation required, such as copy object from source to clipboard (kODCloneCopy), cut object from source to clipboard (kODCloneCut), and so on. When performing a drop, a part must use kODCloneDropCopy or kODCloneDropMove; it should not use the clipboard clone kind kODClonePaste.

After calling this method, you call this draft object's Clone method to clone a particular persistent object. To commit a successful cloning transaction, call this draft object's EndClone method; before the EndClone method has successfully executed, there is no guarantee that all the objects have been copied. If the cloning operation cannot be completed for any reason, you must terminate the transaction by calling this draft object's AbortClone method.

EXCEPTIONS
kODErrCloningInProgress
Another cloning process is in progress.
kODErrInconsistentCloneKind
The specified clone kind is used inconsistently. For example, a paste or drop clone kind can occur only following a copy or cut operation.
kODErrInvalidCloneKind
The specified clone kind is not valid.
kODErrInvalidDestinationDraft
The specified destination draft is not valid for the specified clone kind.
SEE ALSO
The ODCloneKind type (page 917).
The ODDraftKey type (page 902).
The ODDraft::AbortClone method (page 151).
The ODDraft::Clone method (page 162).
The ODDraft::EndClone method (page 171).
"BeginClone" on page 322 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help